Refactor ViewUtils

Improved type safety and reduced complexity.
Merge pull request #35 from nt4cats/master

Refactor ViewUtils