Extract time interval methods to a separate class