Refactored db exports.getAppStat