Refactor multiple scopes

Also removes some cruft while I was in there.