Shortened the script

less white space,
grouped the data and attr calls into one each