Used mutable class-to-instance map instead of regular map, might be safer for primitive types