Refactor controller mixin