Tidy up the main class a bit