samples refactored correspond to api