use template instead of file