Miscellaneous fixes, DRYer