refactor iterateObjects

R=arv
BUG=

Review URL: https://codereview.appspot.com/52210043