Refactored ClientTest