formatted code and add random generator to contact and group tests