adding comments, refactoring Gcm APIs