moved js into files