cleaned up template code cosmetics