use const iterator where possible