Copy from NFCiddle original repo