Minor update - renamed/reorganized some functions