Implementation of ServiceFactory