move more functions out of junk file