Fix problem with twig extension after refactoring, cleanup after review