modularize the stats libs