Update Buffer.js

Refactoring