added a factory to mock time() calls