update time refactor