refactor div ids to avoid iterator