Extract method is_text_only and get_posattrs