fix map resize
map refactoring: extract methods