refactor for easeljs