Revert "Major refactor."

This reverts commit f6e84bb814e504a44f4386afcc8d9891e514a6d3.