added test for request options generation
clean up code