separate template and environment