rewrite in easeljs