Refactoring + updated map parsing.