beanDefinition and refactoring