Tidying up 'generateNative' a little bit