Put those 3 lines in a function. You are using them 3 times.