refactor write_modules_js to standart rhodes jake funcs