#29 move some function from tlssv.hs to Tools.hs