refactored client and server commands