Refactored client: Changed variable names, indentation, etc etc.