Refactoring for terminator problem.