A few touch ups, removed irrelevant legacy code