refactoring to TimeValidator