rfactored templates