Little refacto on sum