Refactored everything not related to the view, out of the view-controller.