Refactoring to clean up container

Moved code that dealt with outerContainer state to the outer
container.