cleaner autodetect code type in appendTemplate() and prependTemplate() :cat: