Pull out plan generation into its own method