AddService code refactored