clean up unused variables and code.