refactoring rowa terminal