This removes a few checks that aren't required anymore and moves some code around to the places where it's actually used.