[TASK] Use flexible and less error prone path detection