moving JS into separate files