methinks we need a refactor to make this awesomer. still not 100% ruby though. ack @xanthousphoenix