Refactor react components