Refactored sample into sequence