Improve logic.