Refactored utils macros