end of refactoring. Finish presentation frame and modify js for callback on animation