Refactored for babel.js