templates refactoring

Signed-off-by: Mateusz Susik <mateusz.susik@cern.ch>