refactor(ui): consolidate ws handlers definition and remove unused code (#10946)