refactoring and performance