Don't keep your computer plugged in overnight
Have learned from painful experience a big contributor to battery issues (swelling, rapidly reduced capacity) is keeping your macbook (pro) plugged in all the time. In theory this should not be an issue but in the real world it seems to be.
So just do the following:
1. If you are not using your computer for more than say 8 hours, disconnect from the external power supply whether it is in sleep mode or powered off. In other words, unplug it before you go to bed or leave work for the day.
2. Use your laptop on battery a few times per week even if you typically keep it plugged in during the day. You don't have to run the battery down, just give it some exercise.
3. Cycle your battery once a month, twice a month tops. Typically that means running the battery down entirely, let it sit for 6 to 12 hours then recharge it completely and keep it plugged in for at least 3 hours before unplugging the power supply. Check applecare for your model's specific procedure.
4. If not using your laptop for 2 weeks or more, charge the battery to 60% to 80%, then remove it until you will be using it again.
Like I said earlier, in theory you should not have to do some of this stuff although cycling your battery once a month is always a good thing. Sadly though, even Apple batteries are not always perfect so some pragmatic battery management will go a long way.