Optimization of carbon coatings on LiFePO4