Redundant casting when using format()