replace instance variable with local variable