Moved dummy data creation into a function.