further clean of for_each code