Refactor cleanups

A bunch of cleanups I thought of when reviewing the last refactoring PR from @ruda.