change new proxy to a seperate function for unit testing