On the cohomology of free and twisted loop spaces