read payload
use streams properly