refactor pattern matcher