minor pep8 and fix depricated key checks
generate full path to templates directory