Revise tools to use MAIN macro