clean up crufty functions