Refactor max-precedence.