extract local variable to method