Optimization refactorings