Refactor docs.js