Reverting this commit: 87a0a6664e because I'm extracting all of this logic into a plugin instead.
87a0a6664e