some refactoring for react.js v0.12.0