improvements for db, reorganization of protected