factor out pocessing stats