some old utility code