Generic path handler