code cleanup
new method to parse a string into a map