Refactor controller classes