move stuff to js file