Ported code ember.js 1.0