Convert Main into an actual class, and use lazy initialisation to construct objects.