Cleaned up a lot of code that is no longer in use