reorganizing the general functionality