[IMP] template engine improved