refactored layers to be expandable