refactor sample1