optimize the DB coding