just suggestion, perhaps, you could wrap all this staff in to the nice init, run, exit app style struct