Not DRY but it gets the job done as a proof of concept. Can work on refinement after it is initially merged into master and tests pass