I recommend moving all this into its own method.