Move code from main devour repo.