further refactoring before quitting the day.