Added support for Map type data
Some code refactoring to remove duplicates