Improving the representation of cost of capital in energy system models