[Chethan, Pranav] Refactored inheritance in templates.