Refactoring templates to use a Variables container