abstracted  logic for determining buffer type to keep things dry.