improved templates a little