Refactor to use stream events