code cleanup ... check functions