[DO NOT MERGE] Initial commit of refactor. Still contains old code.

We could; it is only necessary in this one situation so I don't see it as a high priority.