moved template outside