Replace manual samples parsing with samples array.