Fix Namespaces

Delete an unused variable
Simple DQL for data homepage needs

I don’t like writing DQL, but I’ll do it for Doctrine.