There are some methods that do the same, maybe we can use BaseController to implement the most of this features.