Refactor actions mechanism