Revert "finished refactor"

This reverts commit ebaa09cd4bdfb96ed423b061e44c8e2c6b4603bc.
Revert "finished refactor"

This reverts commit cfbabcda14905c46c48c3ebf9e073825236dcb1c.