introduce type live template context type and get rid of map template from the top level
cleanup
get rid of useless throw clauses