refactored native funcs