Refactor Spring beans