refactoring and code splitting