optimize the dbcode class