Change-Id: I16e1f5f1e8863b09b642c94d4be565e309bdafb6
Did some re-factoring to share code with upcoming (multi stream) packager. Change-Id: I2b3845e48ba6aa63a95ecc276abcb52c8355d8d5