Added templating, updated documentation