refactor container complexity