Moved the react code into a separate js file