remove unused variables and code