refactor actions controller