* Cleaned up code ugh-ness a little bit
 * TODO: even more cleaning up
 * TODO: fix bugs introduced while cleaning