Adding basic support for traits to the template