You could common up this code into a function, and call it 3 times.