Looks like there's a lot of redundancy here. This could probably be much more [DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself).