Sample refactor