Reworked controller/view logic, removed spaghetti code