abstract out the time keeping a little bit