* re-worked code according to changes in service_definition