I would suggest that you create a base function to query given database/collection. Put it into utils/das_db.py. Then re-use it in DBSDaemon and KWS.