two_phase_commit: also follow good JS practices