Code refactored for compactness and readability.
Code refactored for compactness and readability.

Refactored the code to enhance readability.

https://bugzilla.redhat.com/show_bug.cgi?id=1073083
https://github.com/ManageIQ/manageiq/issues/138#event-148990147
(transferred from ManageIQ/manageiq@28d727408902d11ee1f1df2d03fda2d2d88cc0b5)

ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic