Adding MainView.js and refactor.