Refactor CocoView.