Transform window/batch refactoring