refactored reactjs stuff