Moved out the build stack trace into its own method