refactor map/list toggle