Refactor ring_js code to suit dejavu instead