Refactor the CRAP out of this one

* So un-Ruby-ish it hurts the eyes, but that's the best I could come up with right now.
* Big chunks of BI still missing (evidently)