Minor optimization of samples class.