refactoring: add #write and #capacity