Remova literais booleanos de comparações para melhorar a legibilidade.

Código em desconformidade

if var = true then ...
if var = false then ...

Código correto

if var then ...
if not var then ...