Refactor assertMatch method to separate module