refactoring & add prototype bean factory