reorganize beats.js