Refactor some set but unused vars in the frontend