NativeFunction refactoring