Refactored to use main view.