Minor refactoring of map parser and reader.