add map, fix some inlinement issues