refactor that made sense at the time