Change databases implentation to better handle isgood flag