Cleaned up code for creating container view.