even nicer refactorings, moved received bytes into sampleinfo struct