improved acces to db.
changed tests  because internal signal operation db access been changed to minimize the number if quueries.