refactor and add more methods for controlling the thread's shard-connection