Moved js into separate file