refactored the samples