code cleanup - grouped functions