replace instance variables in controller methods with local variables
replace instance variable with local vars after converting frontend to js