Clean codes and fix bugs in ListRecords and ListIdentifiers