remove some redundant code; improve message forwarded from DB errors