Refactoring map and debugging