moved guid generation into a lib