reduced conditional in getAttributeFromModelWithStringFormat method