Second snapshot of this work

Here, I tried to move more of the logic back into two modules