move FTSDatabase class into proper module
refactor using FTSDatabase class