Further improve parse_app_refs matcher