Remove unused variables and macros