Refactor server interface