fix FC023: Prefer conditional attributes
fix FC019: Access node attributes in a consistent manner