use memory function macros where appropriate