reorganizing, some fixes