Restructure block retrieval script