Finished agent server refactor