refactor spring configuration