performance refactorings