I'm not a huge fan of this sort of thing but I think we can tackle it later with a bigger client refactor. You have to be careful of memory thread safety and memory leaks here.