More refactoring of gis.js & gis.ejs