Clean up code of equalToBool and simplify mismatch statement