Refactor the pm2.5 caculate function