Extracted matching to separate package and implementation