remove usage of iterator