Refactor ActionManager.