separating code on its own js file