Making beanFactory by using Reflection