Divided the app into model, view and controller.