Switch from @Bean to protected method