Adding some macros to make the code a little easier to follow.