Refactoring local variables in methods