move spring get beans to separate method