Merging these 6 lines into 3