Moved js into 2 files