Refactored to use steps instead of events