Refactor to make creds optional.