Added data padding for statistics; refactored for simplicity.