Use some sneaky macros to make this a little more concise.