My only qualm is here, I don't like adding more paths to methods that are arguably too big already. What if we factored out the logic into procs, like this: https://gist.github.com/jacknagel/5131542