proxy: split out service state management