Refactored to use signals