More cleanup on templates