Issue #1: get message class from the template type