adapted to template