split streamam.c into code loader and data loader