Added duplicated functionality to BaseController