performance refactoring