more refactoring and getting rid of globals in router specs