moved non client code to test_client