cleanup in service code