Refactoring container code.