Revert "A messy merge". It was messier than I originally thought.

This reverts commit 5a585a0f1e431fe5ce9006b8e272975881fb01fb, reversing
changes made to 038b70f50db910fac49d67f14176ee86841a4145.