format file output. remove json.dump