Create a function for this line? It seems to be repeated a whole bunch of times..?