Refactor Categories Controller