restrict routes
replace instance variables with local variables