Refactoring twig