simple refactor of map generation code.