Refactor elements and containers