This seems to be the same fix applied to every function, should we abstract it into a single method?