migrate fns to mapi