Refactor the boolean fix