Cleared up connection events and prepared for ui integration