remove unused variables and comments