allow client to set connect mode
client refactor