promote setmap out of fn
break up long fn