Template documentation. Relates to #11
Template fixes. Relates to #11
Optimizations. Relates to #11