Code cleanup
1. Change HashMap to Map
2. Change order of modifiers to static final
3. Use of constants instead of string literals used throughout the class
4. Minimize lines of code of anonymous classes
5. Move [] beside the type instead of the variable in declaration
6. Always log errors
7. Change order of equals comparison (string literal should come first)

GCP-10239

Reviewer: Aldrin Batac