Improve resource laoding and add resources "text" for inline templates