switch pattern to path