Move buffer creation into Util module.