reactive templates working with shared variables