Time refactor