Convert task into macrodef