Update cs.js

Global refactoring