Created a controller plugin for handling common functions