Use type literals in template

Hard coded type names may lead to problem in rare situations, e.g. the messages annotation should not break for types like 
class X<MessageFormat> {}