Continuing work on refactor, not much more to go now hopefully