use some instance variables instead of so many local variables (controller -> views)