Refactor actionQueue