Refactor test-server to command server