Cleaned up client.cpp