Reduce weird code in document, make template code a different kind of weird