refactored connection manager to use event streams