optimize spring configuration