is there a reason why this class needs to be created every time you call a function? can you make it work with a single instance that is shared by all the functions?