faster variable out handling in templates