Doctrine resource, refactoring