coercion matcher function refactoring