utils. code cleanup