almost done refactoring Map stuff