architecture changed for flexible layer adding/deleting