added environment as a local view var; small template tweaks