Removing mildly weird code

Unnecessary switch/forEach removed.
Merge pull request #773 from Ralt/patch-1

Removing mildly weird code