Slight code refactoring.
Cleaned up a little of the view code by adding a helper.