Run sortRequires and remove unused variables.