Refactor for react

Use react for the client side