cleaning up service code