changed how client is configured, refactored code/tests to work