removed looping; using template calls instead