Improve scratch buffer