Split the pitch logic into its own class.