Still needs linting fixes, probably bugs, this commit should be used as a draft of what a separation of these concerns might look like.