Added macros to reduce boilerplate code.