simplified the client generator code
added test_generator_cleanup