Make generic execute function