move js to separated file