sample: Propagate sample entry into inferior functions.
sample: Make a function to get rid of the duplicated codes to append a sample.