refactored templates