fixing formatting
refactoring using writeByteBuffer() from Utils.