refactoring using spring annotation