Refactor React components