Refactor unserialize of (Ordered-)Dict