minor changes

Now the dictionary does not store one instance of each class, just a
reference to the class. The object is created just before return