remove unused variables and function