Refactored server and client commands