refactor dense stats