Code cleanup in main, creation of datasets for static variables