Refactors intent sending and receiving code into helper classes.