simplify the js