Remove unneeded macros, change the way function defined