Breaks out the data code into its own method.