Refactoring find elem for terminator problem.