Refactor time functions out behind a protocol