Clean up duplicate code and add new matchers.