Refactor some controllers