refactor: add input sanity checks to mapExecute()