Improve test coverage
Add Bytes() and refactor codes to use bytes.Buffer