Refactor sample.