Refactor WOTSTATS writer.