Cleaned up a lot of old code.