add support for macros and make some improvements