moved logic from router to viewmanager