Decouple data fetch and data encoding