Splitting index/query into their own scripts