Reflection based class registration on factory