app server refactor