Why is the format repeated both here and in the js?