Update Rih.js

reduce code