Revert "In progress refactor"

This reverts commit 938f253036c3fb8dc6ddc93f2060a75580b1b995.