move extra funcs into pywrap so we can make them static