Updated template with constraints