initial refactoring of push notifications