moves queries out of logs and into own files