reimplementation using tag-templates as a base, now 1/4 the code!