Remove unused variables and some cosmetic