Refactor react.