Improve queries in appUtils.js