[tor-commits] [tor/release-0.2.4] refactor and give it unit tests