start to convert #DEFINE macros to function decorators