Miscellaneous small refactors.