path calculation according to paths of the templates; fixes #1