reorganized bp.js