Refactored Time class