refactor
cache buffers instead of strings in memory