use buffers for updates and handle input encoding