refined path function, fixed format func