reorganize code, delele/create_layer added