add an interface for the timefactory class

fix indention