         }
     }
 
+	@IBOutlet private weak var toolbar: UIToolbar! {
+		didSet {
+			toolbar.tintColor = .katangaYellow
+		}
+	}
+
     private var disposeBag = DisposeBag()
+
+	private lazy var mapViewController: UIViewController = {
+
+		let storyboard = UIStoryboard(name: "Main", bundle: nil)
+
+		let mapVC = storyboard.instantiateViewController(withIdentifier: "mapVC") as! MapViewController
+		mapVC.viewModel = self.viewModel
+
+		return mapVC
+	}()
+
+	private lazy var linesViewController: UIViewController = {
+
+		let storyboard = UIStoryboard(name: "Main", bundle: nil)
+
+		let linesVC = storyboard.instantiateViewController(withIdentifier: "linesVC") as! RouteStopsViewController
+		linesVC.viewModel = self.viewModel
+
+		return linesVC
+	}()
 
     override func viewDidLoad() {
         super.viewDidLoad()
 
-        initialize(tableView: tableView)
-
-        bindViewModel(tableView: tableView, driver: viewModel!.getBusStops())
-            .addDisposableTo(disposeBag)
+		add(viewController: mapViewController)
 
         viewModel?.routeId()
             .drive(rx.title)
-            .addDisposableTo(disposeBag)
-
-        tableView.rx.modelSelected(BusStop.self)
-            .subscribe(onNext: { [weak self] in
-                self?.performSegue(withIdentifier: "times", sender: $0)
-            })
             .addDisposableTo(disposeBag)
     }
 

    typealias Model = BusStop
    typealias CellType = BusStopCell

    public var viewModel: RouteDetailViewModel?

    @IBOutlet private weak var tableView: UITableView! {

        vc?.viewModel = viewModel
    }

	@IBAction func segmentedControlValueChanged(_ sender: UISegmentedControl) {
		if sender.selectedSegmentIndex == 0 {
			add(viewController: mapViewController)
			remove(viewController: linesViewController)
		}
		else {
			add(viewController: linesViewController)
			remove(viewController: mapViewController)
		}
	}

	private func add(viewController: UIViewController) {
		addChildViewController(viewController)

		view.addSubview(viewController.view)

		viewController.view.translatesAutoresizingMaskIntoConstraints = false

		viewController.view.topAnchor.constraint(equalTo: self.toolbar.bottomAnchor).isActive = true
		viewController.view.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
		viewController.view.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
		viewController.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true

		viewController.didMove(toParentViewController: self)
	}

	private func remove(viewController: UIViewController) {
		viewController.willMove(toParentViewController: nil)

		viewController.view.removeFromSuperview()

		viewController.removeFromParentViewController()
	}

}
