Added more templates.
Moved modal operation into