More refactoring and adds the start of the routing setup