improve data sampling scripts