Refactored the MainForm constructor as it was getting out of hand.