Make Buffer more generic