refactoring of path template rendering
code deduplication/refactoring