Refactor Generic Sample