Revert "Major refactor update.". Accidently wiped the last few commits out of history.

This reverts commit 4d8d062c528cf08f60ac347ccef18da1c06925dd.