Moved the execution into its own function.