Extracted repeating code segment to a method.