moved duplication to helper