stat for all, refactoring