Twig  refactoring