implemented ClockService and related classes