Added a couple of macros and sentry objects to make code more readable.