Moved texture generation into its own method