cleaned up proxy code and ensured tests don't run out of memory