Refactoring TrafficLightEndpoint