Did a first round of cleanup of the most obvious parts