Changing former bad understading of Doctrine to neat code