refactored to add function on `gii.js`