move _mode functionality to buffer