(ftr) slight cleaning of main event loop