Moved stats to a lib