Change queries list to global only
Clear some old code