Refactor.
Merged frostwire-common changes