shortened the attribute normalization code