Adding support for badge map
minor fix for badge map
bit of refactoring
commit
Some refactoring