Simplify code for calculating bytes written