made fully templatable