refactor Controller