refactored tolerance system