Feature/more flexible template handling