Moved drawing implementation to MainView.