Refactor container formatting