Bunch of utilities moved from socnet project