Added TemplateNotFoundError exception
Minor refactoring
Added hash method