Cleaned up some of the messier bits