Refactor container creation