refactored Sample