Probably worth holding on to a version of samples.split('@') since you seem to use it a number of times.