Some convenience macros and rearrangement.