add controller
refactor controller with callbacks