Refactor pathjoin, formats, and start publisher