Refactor to use Flux for React