restructure a lot of the service code, update dependencies