Refactor samples