[WIP]: Router refactor

For #512