Refactor out a timer class