Use mkMerge to make the code a little more ergonomic and easier to follow (to my eyes, anyway ...). Also take the opportunity to do some minor cleanups & tweaks, but no functional changes.