Moved js into separate files