is it inefficient to recreate the dictionary and then discard it every time the method is called?