style fixes
use is/is not None instead of ==/!=