Refactored Spring configuration to remove duplicated bean definition