Moved plan creation into its own method