Remove unused variables and outdated comments