Better id field detection