converted private fields to locals