refactor: further reduce dependency on router