use @class as template var, small fixes