Refactor Controller