reducing code on tests