Reformat code

Move search guid code to its own file