refactorer Credentials constructor