CredentialsDB improved and moved for better consitency