refactor samples