expression optimizer, refactoring