Abstract source buffer into class