Remove code dupĺication on tests.