Move subpath merging to path embedding