Lots of cleanup..  I should probably structure this
better...