refactor: refactor Connect's constructor