refactor map state