add some db indexes
replace instance variable with local variable