use instance variables instead of locals for view