Improve handling of server state (combine separate variables into one state variable)
Merge branch 'server-state'