refactored tonton.js