added inline template support