Cleanup client and command code