Update @Ohmnivore changes to allow messier code, plus some other cleanup