refactor statistics computation