Refactor/router

ended up being a bit more than just router fix