Changed datastream construction order