Reduce passing of map and avoid rendering when visibility changes
Add basic jsdoc comments