Reflection code added for dynamic class instance creation