refactored hub connecting