Improved array serializaion