improved templates and tests