Added factory classes and refactored getServiceConfig