A more extensible way of refactoring the code is to attempt to separate the logic into presentation logic and business logic layer.Keep the presentation logic in the controller actions, and accompanying helper classes where required.
By separating the business logic from the UI, we are able to implement alternative UIs – a Web API for example – that utilize the same logic.
The controllers are not dependent on a specific data-access technology.
We can switch technologies without needing to change any controller coding or references.
This specific piece of logic is therefore required in more than one controller.
We can create one or more helper classes in our MVC project, and create helper methods that can be utilized by the controller actions.