refactored fayPath function

The helpers might be factored out later.