Refactored to use new macros