Optimize 'ObjectFactory' class design & implementation.