Bunch of cleaning up to make it somewhat useful