replace some more occurences
move some other occurences of require to import and fix some code generation issues