Further, the goal of life is not "the removal of pain" because "the goal of life" is defined by the philosophers to be that ultimate end for which you do everything else. Again, see Torquatus' narrative: (IX. I will start then in the manner approved by the author of the system himself, by settling what are the essence and qualities of the thing that is the object of our inquiry; not that I suppose you to be ignorant of it, but because this is the logical method of procedure. We are inquiring, then, what is the final and ultimate Good, which as all philosophers are agreed must be of such a nature as to be the End to which all other things are means, while it is not itself a means to anything else. This Epicurus finds in pleasure; pleasure he holds to be the Chief Good, pain the Chief Evil.)
You do not "remove pain" as the ultimate goal unless you want to go ahead and die, because the only way to be ultimately sure to experience no further pain is to die. If removal of all pain is your goal, then die, as I gather Marcus Aurelius (or was it someone else?) said to or about the Christians.
In the Epicurean view you "remove pain" in order to experience pleasure. Pleasure is the ultimate goal that you pursue, and which you calculate toward in making all decisions, up to the point when you die. You don't calculate all decisions against achieving total absence of pain unless you want to go ahead and die, or wish you had never been born, both of which Epicurus expressly ridicules in the letter to Menoeceus.