Refactor to use Doctrine directly for far better performance