added some templeting