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