very rough implementation of internal macros