refactor, add controller