Some refactoring of the MainContent component

Change-Id: Id3b2b7c46d8da27260d62c05c42817e46b3bb64c