better get or create buffer functionality