Refactoring undefined logic.