chore: cleanup and improve `pathWithContext` service