time refactor