Abstract out adding and removing layers