samples refactor