Inlined version of templates