suggestion for connect() implementation