refactored Time class