refactoring - converted fields to local variables