template improvments