Added templates and changed minor things