modify each_layer to define its type