Make template more general