Added factory and service definition.