improve class instantiation