clean up service code