refactoring of pushnotification