Revert "Use batch stats calls, and fix most of the style issues"

This reverts commit 3efb1ec821d0e933b78ed90a0d7ba79a4e1679e6.