Refactor: Extract condition for arity check