Refactor react.js template