Removes deprecated attribute and DRY
Style fix