Refactoring with spring