Cleanup macro generator