Next round of cleanup. Some of this code looks familiar!