refactor + timestamp sample