refactory the native call