Reduce ApplicationHelper complexity.
Fix javascript issue revealed by code climate.