Move sample function to a sample module