added templates, moved external scripts