Doctrine refactored