Define functions only on buffer.