DRY up some sopping wet code