Refactor: using hash to determine sensor icon.

Several optimization on code readability.
Refactor: Using enum to indicate severity.

Using enum instead of magic constants to indicate severity.
Removed unused strings.