improve code for ffndb.