extract writing matchings into method