refactor Shared and Tor Helper