Refactor Server (incomplete)