[1030889] Refactored functionality for creating an expandable container