refactoring and expansion