Refactored MainForm a bit