Rework much of the service.c code: