Started tinkering with fixing cyclic dependency
Moving lots of functions around