Complete refactor of time operations