Refactored for TB 3.0.0.