Refactor by adding a `ports` property to the Router.