separate writeBuffers for dataTypes, speed up DB-writing, code cleanup