move some code to utils/; delete old unused junk