inlined some macros