Optimized unserialize