implementing adt macros