Optimize writes as much as possible