flatten data (for redis save)