fix(views): replace array walk with a foreach loop

fixes #2