refactor check_actions for better reuse