Replaced use of custom buffer type with stdlib implementation