Fix dependency problem. Extract and unify router deployment stuff