maptool refactoring