refactoring GcmTest code