refactor router operation modes