Refactoring fields to local variables