Refactoring, better approach with no need of declaring more Beans.