Cleanup up the code a bit, added some reusable methods, changed the support structure to be a little more solid.