Extracting main controller from router.