Remove unneccessary locations from memory instructions