There are actually several valid implementations of the MVC pattern for this application. What fundamentally characterizes the application as an MVC application is that the developer (s) shares functionality in three broad categories of model, view, and controller.
In most cases, the model contains an abstraction of the current state of the application and / or the underlying data. A view contains everything that processes a presentation. The controller is usually an intermediate instance between the view and the model and vice versa: for example, if user input changes the data model, the controller must apply these changes (or discard them if they are not valid); and vice versa, if there is a state in the model that is defined to obtain a certain result in the view, the controller will provide this.
These are blurry lines. The applicability of MVC design is usually limited to the programming language you use.
In other words, you need to improvise to some extent. Separate functions, as far as reasonable, but do not overdo it where it does not make sense.
Several resources:
source share