Problems in creating a refclass in one of the methods imported from package(since it's locked environment)

So I'm trying to build a package that creates a refclass after importing it, cause the idea is to build a refclass to a specific templates, which contains specific parameters that will be considered as attribute for the class I create. So when I'm working in my environment it works fine, since the environment is then not locked yet.
But when I build the binary package and load it(for e.g. in Jupyter Notebook), of course the environment of this package will be locked, so when I execute one of these methods, I'll get the following error "Error in assign(mname, def, where): cannot add bindings to a locked environment" which cause by building the ref class with the eval parse paste idea.