refactor parsing of events received from hippie server into a method