style fixes + iterator duplication