Refactoring event pipe