improve arrays serialization