[wip] server refactor