make functions consistent using macros