Remove infinite loop caused by refactoring