Server refactor