refactor action processing