Could you please simplify this to check `sitetree_link` and `file_link` in the same match and following logic?